﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace BoxSharp
{
    /// <summary>
    /// Interaction logic for BoxSharpWindow.xaml
    /// </summary>
    public partial class BoxSharpWindow : Window
    {
        public BoxSharpWindow()
        {
            InitializeComponent();

            Box.KeyDown += new KeyEventHandler(Box_KeyDown);
        }

        void Box_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                string command = Box.Text;

                BoxSharpAddonManager.Singleton.OnCommand(command);
            }
        }

        private void BSWindow_Loaded(object sender, RoutedEventArgs e)
        {
            BoxSharpAddonManager.Singleton.Initialize(BSWindow, BSPanel, BSPanel1, BSPanel2, Box);
        }

        private void BSWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            BoxSharpAddonManager.Singleton.Exit();
        }
    }
}
